const { defineConfig } = require('@vue/cli-service')
const Mock = require('mockjs')
const {list} = Mock.mock({
    'list|10':[{
      'id|+1':1,
      'image':'@image(300X100,@color)',
      'title2':'@ctitle(2,5)',
       'title':'@ctitle(3,15)',
       'price|1-100.1-2':1
    }]
})
module.exports = defineConfig({
  transpileDependencies: true,
   devServer:{
     setupMiddlewares:(mid,dev)=>{
        dev.app.get('/api/list',(req,res)=>{
          res.send({
            code:200,
            data:list
          })
        })
        return mid
     }
   }
})
